Date: 2015.05.08
Author: Pascal Sirguey, pascal.sirguey@otago.ac.nz

compute a smoothed average surface velocity map for tasman galcier from 2000 to 2011 (11 velocity maps from pairs of ASTER images from 2000 to 2011, see Redpath, 2011; Redpath et al. 2013).
Used V002 dataset fixed for some time differences.

Compute raw average:
---------------------
In Arc: use raster calculator. set environment parameters to be processed on largest extent.
The mean is computed regardless of NoData values:
(
Con( IsNull("1011ffv2_V002.tif"), 0, "1011ffv2_V002.tif" ) +
Con( IsNull("0910ffv4_V002.tif"), 0, "0910ffv4_V002.tif" ) +
Con( IsNull("0809ff_V002.tif"), 0, "0809ff_V002.tif" ) +
Con( IsNull("0708ff_V002.tif"), 0, "0708ff_V002.tif" ) +
Con( IsNull("0607ff_V002.tif"), 0, "0607ff_V002.tif" ) +
Con( IsNull("0506ff_V002.tif"), 0, "0506ff_V002.tif" ) +
Con( IsNull("0405ff_V002.tif"), 0, "0405ff_V002.tif" ) +
Con( IsNull("0304ff_V002.tif"), 0, "0304ff_V002.tif" ) +
Con( IsNull("0203ff_V002.tif"), 0, "0203ff_V002.tif" ) +
Con( IsNull("0102ff_V002.tif"), 0, "0102ff_V002.tif" ) +
Con( IsNull("0001ff_V002.tif"), 0, "0001ff_V002.tif" )
)/ (
(~ IsNull("1011ffv2_V002.tif")) +
(~ IsNull("0910ffv4_V002.tif")) +
(~ IsNull("0809ff_V002.tif")) +
(~ IsNull("0708ff_V002.tif")) +
(~ IsNull("0607ff_V002.tif")) +
(~ IsNull("0506ff_V002.tif")) +
(~ IsNull("0405ff_V002.tif")) +
(~ IsNull("0304ff_V002.tif")) +
(~ IsNull("0203ff_V002.tif")) +
(~ IsNull("0102ff_V002.tif")) +
(~ IsNull("0001ff_V002.tif"))
)

=> mean_0011ff_V002.tif (150m pixel size = 10 aster pixels was the grid used in CIAS)

Smooth the average:
---------------------
	In Arc geostatistical toolbox:
	- use universal kriging
	- The trend is relatively complex so detrending is done until finding an appropriate variogram
		- constant order with exploratory trend surface
			- polynomial kernel with bandwith 20
			- explored variogram up to 20km lag, most of the trend is removed, the variogram dips a bit at larger lags due to the periodicityin the data
			- model variogram
				- lag size 50
				- nb lag 100
				- stable model with nugget, no anisotropy
					=> 2040m range (interesting)
			- interpolation
				- standard
				- 4 sectors, max nb 50,min nb 2 up to range
			- cross valid
				- RMS = 9.65 m.s-1 (mean = 0.03)
	- final interpolation
		- 50m pixel size -> mean_0011ff_V002_kg2.tif
		- mask with raster calculator:
			"mean_0011ffv2_V002_kg.tif"*"mean_0011ffv2_V002.tif"/"mean_0011ffv2_V002.tif"	
				=> mean_0011ffv2_V002_kg_masked.tif
		- derive contours
			- 20m
				=> mean_0011ffv2_V002_kg_masked_cl20.shp